<html>
    <head></head>
    <body>
        <p><a href="<?php echo MANAGE_ACCOUNT_REDIRECT;?>"><?php echo MANAGE_ACCOUNT_REDIRECT;?></a> | <a href="<?php echo MODULE_LIST_LINK;?>"><?php echo MODULE_LIST_LINK;?> </a> | <a href="<?php echo MAIN_CATEGORY_LIST_LINK;?>"><?php echo MAIN_CATEGORY_LIST_LINK;?></a> | <a href="<?php echo SUB_CATEGORY_LIST_LINK;?>"><?php echo SUB_CATEGORY_LIST_LINK;?></a>
<form method="post" action="<?php echo ADD_NEW_USER_DATA;?>" onsubmit="return checkForm(this);">
    <input type="hidden" name="csrf_token" value="<?php echo $data['page']['csrf_token'];?>'"/>
    <input type="hidden" name="user_id" value="<?php echo $data['page']['id'];?>"/>
        <fieldset id="registry">
                <label for="user_email"><?php echo ENTER_YOUR_EMAIL;?></label>
               	<input name="user_email" id="user_email" type="email" required value="<?php echo $data['page']['user_email'];?>">
        </fieldset>
        <fieldset>
        		<label for="user_name"><?php echo ENTER_YOUR_USERNAME;?></label>
        		<input name="user_name" id="user_name" type="text" required value="<?php echo $data['page']['user_name'];?>">
        </fieldset>
        <fieldset>
        		<label for="user_password"><?php echo ENTER_YOUR_PASSWORD;?></label>
        		<input name="user_password" id="user_password" type="password" required pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z])\w{6,}"><?php echo PASSWORD_MESSAGE; ?>
        </fieldset>
        <fieldset>
        		<label for="user_password_validation"><?php echo RETYPE_YOUR_NEW_PASSWORD;?></label>
        		<input name="user_password_validation" id="user_password_validation" type="password" required pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z])\w{6,}">
        </fieldset>
        <input type="submit" value="<?php echo MANAGE_ACCOUNT_SUBMIT;?>" />
</form>
<form method="post" action="<?php echo UPDATE_MAIN_USER_DATA;?>">
    <input type="hidden" name="csrf_token" value="<?php echo $data['page']['csrf_token'];?>'"/>
    <input type="hidden" name="user_id" value="<?php echo $data['page']['user_id'];?>"/>
        <fieldset id="field_firstname">
                <label for="firstname"><?php echo USER_FIRSTNAME;?></label>
               	<input name="firstname" id="firtsname" required type="text" value="<?php echo $data['page']['firstname'];?>">
        </fieldset>
        <fieldset id="field_surname">
                <label for="surname"><?php echo USER_SURNAME;?></label>
               	<input name="surname" id="surname" required type="text" value="<?php echo $data['page']['surname'];?>">
        </fieldset>
    <input type="submit" value="<?php echo UPDATE_USER_MAIN_DATA_SUBMIT;?>" />
</form>
<form method="post" action="<?php echo UPDATE_COMPANY_USER_DATA;?>">
    <input type="hidden" name="csrf_token" value="<?php echo $data['page']['csrf_token'];?>'"/>
    <input type="hidden" name="user_id" value="<?php echo $data['page']['user_id'];?>"/>
    <fieldset id="company_name">
        		<label for="company_name"><?php echo USER_COMPANY_NAME;?> </label>
        		<input name="company_name" id="company_name" required type="text" value="<?php echo $data['page']['company_name'];?>">
        </fieldset>
        <fieldset id="field_comapny_tax_idetification_number">
        		<label for="company_tax_identification_number"><?php echo USER_COMPANY_TAX_IDENTIFICATION_NUMBER;?></label>
        		<input name="company_tax_identification_number" id="company_tax_identification_number" type="text" required value="<?php echo $data['page']['company_tax_identification_number'];?>">
        </fieldset>

        <fieldset id="field_company_regon">
                <label for="comapany_regon"><?php echo USER_COMPANY_REGON_NUMBER;?>*</label>
               	<input name="company_regon" id="company_regon" type="text" value="<?php echo $data['page']['company_regon_number'];?>">
        </fieldset>
        <fieldset id="field_company_street">
                <label for="company_street"><?php echo USER_COMPANY_STREET_NAME;?></label>
               	<input name="company_street" id="company_street" type="company_street" required value="<?php echo $data['page']['company_street'];?>" required>
        </fieldset>
        <fieldset id="local numbeber">
        		<label for="company_local_number"><?php echo USER_COMPANY_LOCAL_NUMBER;?></label>
        		<input name="company_local_number" id="local_number" type="text" required value="<?php echo $data['page']['company_local_number'];?>">
        </fieldset>
        <fieldset id="field_company_postal_code">
        		<label for="company_post_code"><?php echo USER_COMPANY_POSTAL_CODE;?></label>
        		<input name="company_post_code" id="company_post_code" type="text" required value=""<?php echo $data['page']['company_postal_code'];?>>
        </fieldset>
        <fieldset id="field_company_city">
                <label for="company_city"><?php echo USER_COMPANY_CITY_NAME;?></label>
               	<input name="company_city" id="company_city" type="company_city" required value="<?php echo $data['page']['company_city'];?>">
        </fieldset>
        <fieldset id="field_company_email">
                <label for="company_email"><?php echo USER_COMPANY_EMAIL;?></label>
               	<input name="company_email" id="company_email" type="email" required value="<?php echo $data['page']['company_email'];?>">
        </fieldset>
        <fieldset id="field_company_telephone_number">
        		<label for="company_telephone_number"><?php echo USER_COMPANY_TELEPHONE_NUMBER;?> </label>
        		<input name="company_telephone_number" id="company_telephone_number" type="text" required value="<?php echo $data['page']['company_telephone_number'];?>">
        </fieldset>
        <fieldset id="field_fax">
        		<label for="company_fax_number"><?php echo USER_COMPANY_FAX_NUMBER;?>*: </label>
        		<input name="company_fax_number" id="company_fax_number"  type="text" value="<?php echo $data['page']['company_fax_number'];?>" required>
        </fieldset>
    <input type="submit" value="<?php echo UPDATE_USER_COMPANY_DATA_SUBMIT;?>" />
</form>
<form method="post" action="<?php echo UPDATE_PRIVATE_USER_DATA;?>">
    <input type="hidden" name="csrf_token" value="<?php echo $data['page']['csrf_token'];?>'"/>
    <input type="hidden" name="user_id" value="<?php echo $data['page']['user_id'];?>"/>
        <fieldset id="field_user_tax_identification_number">
        		<label for="user_tax_identification_number"><?php echo USER_PRIVATE_TAX_IDENTIFICATION_NUMBER;?></label>
        		<input name="user_tax_identification_number" id="user_tax_identification_number" type="text" value="<?php echo $data['page']['user_tax_identification_number'];?>">
        </fieldset>
        <fieldset id="field_ulica">
                <label for="user_street"><?php echo USER_PRIVATE_STREET;?>*</label>
               	<input name="user_street" id="user_street" type="text" required value="<?php echo $data['page']['user_street'];?>">
        </fieldset>
        <fieldset id="field_local_number">
        		<label for="local_number"><?php echo USER_LOCAL_NUMBER;?>*</label>
        		<input name="user_local_number" id="user_local_number" type="text" required value="<?php echo $data['page']['user_local_number'];?>">
        </fieldset>
        <fieldset id="field_user_postal_code">
        		<label for="user_postal_code"><?php echo USER_POSTAL_CODE;?>*</label>
        		<input name="user_postal_code" id="user_postal_code" type="text" required value="<?php echo $data['page']['user_postal_code'];?>">
        </fieldset>
        <fieldset id="user_city">
                <label for="user_city"><?php echo USER_CITY_NAME;?>*</label>
               	<input name="user_city" id="user_city" type="text" required value="<?php echo $data['page']['user_city'];?>">
        </fieldset>
        <fieldset id="field_tel">
        		<label for="user_telephone_number"><?php echo USER_TELEPHONE_UNUMBER;?></label>
        		<input name="user_telephone_number" id="user_telephone_nymber" type="text" value="<?php echo $data['page']['user_telephone_number'];?>">
        </fieldset>
    <input type="submit" value="<?php echo UPDATE_USER_PRIVATE_DATA_SUBMIT;?>" />
</form>

        <p><a href="<?php echo MANAGE_ACCOUNT_DELETE_ACCOUNT_ACTION;?><?php echo $data['page']['id'];?>" alt="<?php echo MANAGE_ACCOUNT_DELETE_ACCOUNT;?>" title="<?php echo MANAGE_ACCOUNT_DELETE_ACCOUNT;?>"><?php echo MANAGE_ACCOUNT_DELETE_ACCOUNT;?></a>
            <script type="text/javascript"> 
            function checkPassword(str) { 
                var re = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])\w{6,}$/; return re.test(str); 
            } 
            function checkForm(form) {
                if(form.user_name.value == "") {
                    alert("<?php echo BLANK_USERNAME;?>"); 
                    form.user_name.focus(); return false; } re = /^\w+$/; 
                if(!re.test(form.user_name.value)) { 
                    alert("<?php echo USERNAME_ERROR;?>"); 
                    form.user_name.focus(); 
                    return false; 
                } 
                if(form.user_password.value != "" && form.user_password.value == form.user_password_validation.value) { 
                    if(!checkPassword(form.user_password.value)) { 
                        alert("<?php echo PASSWORD_NOT_VALID; ?>"); 
                        form.user_password.focus(); 
                        return false;  
                    } 
                } 
                else { 
                    alert("<?php echo BAD_PASSWORD;?>");
                    form.user_password.focus();
                    return false; 
                } 
                return true; 
            }
                     </script>
    </body>
</html>
